"""
l1 = list((1,2,3),({'a':'a'}),(4,5,6)) # TypeError: list expected at most 1 argument, got 3
print(l1)
l1 = list({'a': 'a1', 'b': 'b1'})  # 传入的是字典获取的是key值
print(l1)

l2 = list('abc')
for item in l2:
    print(item)

for item in l2:
    print(item)

l1 = [1,2,3]
print(l1[::-1]) # [3,2,1]
print(l1[:-1]) # [1,2]

"""

"""
l1 = [1,2,3,4,5,6]
l2 = l1[::]
# append vs extend(iterable)
l1.append([4,5,6])
l2.extend([4,5,6])
l2.extend({'a':'a1','b':'b1'})
print(l1)
print(l2)

"""

"""
fruits = ['apple','orange']
fruits.insert(1,'aaa')
fruits.insert(0,11)
print(fruits)
"""

# 删除元素
# remove(x) pop(index) del(index) clear()
l1 = [1,2,3,4,5,6]
del l1[0:2:2]
print(l1)

l1 = [1,2,3]
l2 = [(1,2),(2,3)]
print(l1 + l2)
print(l1)
# print([1,2,2] + (2,2)) 报错

l3 = [1,2,3]
l4 = enumerate(l3)
print(l4)
for item in l4:
    print(item)
for item in l4:
    print(item)

l5 = ['1','2','3']
l6 = [item + 'L7m' for item in l5]
print(l6)

l7 = [1,2,3,4,5,6]
l8 = [item for item in l7 if item % 2 == 0]
print(l8)




